import "reflect-metadata";

export function Get(path: string = ""): MethodDecorator {
  return function (target: any, propertyKey, descriptor: PropertyDescriptor) {
    // 给方法添加 metadata
    Reflect.defineMetadata("path", path, descriptor.value);
    Reflect.defineMetadata("method", "get", descriptor.value);
  };
}

export function Post(path: string = ""): MethodDecorator {
  return function (target: any, propertyKey, descriptor: PropertyDescriptor) {
    // 给方法添加 metadata
    Reflect.defineMetadata("path", path, descriptor.value);
    Reflect.defineMetadata("method", "post", descriptor.value);
  };
}
